#!/usr/bin/python
"""
convert ptb-style tree (multi-line tree) to single line
"""

import sys, os


lines=[]
for l in sys.stdin.readlines():
	if len(l.strip()) == 0:
		continue
	if l.strip()[0] == '<' and l.strip()[-1] == '>':
		continue
	lines.append(l)
sentstr="".join(lines)
sys.stdout.write(sentstr)
